UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XMPYFo7hkez8smZGXNB8ium1BCizmxGUWDynIKep+Cc='
WHERE
key_id = '2ea8fcee9c6ab044639ce7d499f4c5914e6ad445ebcfb985923dc55207537086'
AND (
token = 'XMPYFo7hkez8smZGXNB8ium1BCizmxGUWDynIKep+Cc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)