UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c83NlANPdRR/WDvnbkW6Sx7RNJ8xMBn6iAj90zUazGU='
WHERE
key_id = '89731b012aa5b8a03b85655e795ffe02e6af154d5ca83ed4d58298306fccac1d'
AND (
token = 'c83NlANPdRR/WDvnbkW6Sx7RNJ8xMBn6iAj90zUazGU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)