UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K0Q9FTk5YOKim0l2FN/CfVQPycCSKMt6ekTZJJM+qD4='
WHERE
key_id = '57df76570c5ebbaf1fafd459644711a9a73ca4db007b9f6af84c8a7977d996f3'
AND (
token = 'K0Q9FTk5YOKim0l2FN/CfVQPycCSKMt6ekTZJJM+qD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)