UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RhDqHCBS4MR1SzaaXl/4PsDqlLbpJWgosaOjFcy+cbQ='
WHERE
key_id = '1a3a9a12ea4ea6692b87dd7f8cc77d5ae826d47bfd797cfa6a9f81150205b559'
AND (
token = 'RhDqHCBS4MR1SzaaXl/4PsDqlLbpJWgosaOjFcy+cbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)