UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XS8ZmlyY/sohQ1UKFYxpSfIkmEDR8KBIKZ/oGl2QimQ='
WHERE
key_id = 'f5bc3b491e47e03afd9ecf0eb117f154ef7365de44e288a76262104f499904fe'
AND (
token = 'XS8ZmlyY/sohQ1UKFYxpSfIkmEDR8KBIKZ/oGl2QimQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)