UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PMH7AgnI0Dy+NkjHMZMQqwc3qV91wKb9djmVCE9hinM='
WHERE
key_id = 'c982e1416e04ca7e3b76ef1355d7e9dbdba01b351986cdca2a6672dec9a25465'
AND (
token = 'PMH7AgnI0Dy+NkjHMZMQqwc3qV91wKb9djmVCE9hinM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)