UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c3ULMFVfpi/5Sl9kryxWKq6+pWUHMFn7BtEMnmMG3dk='
WHERE
key_id = 'fdf03a0e56553f4525736366526481637db0a94e90bba48dda8ebf6300e418fa'
AND (
token = 'c3ULMFVfpi/5Sl9kryxWKq6+pWUHMFn7BtEMnmMG3dk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)