UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C+SzAPHzy9ers+lxcA6pYLLHjJ1oJTwR+bpPvn7FZ9g='
WHERE
key_id = '24eb4bdd8eca194eba51bac6f6fc5ab696b9f911a330bbc97e41d28ee6e71ebc'
AND (
token = 'C+SzAPHzy9ers+lxcA6pYLLHjJ1oJTwR+bpPvn7FZ9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)