UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RqjvQV6ziJfvQHsJqYIl5AFTKgjkftT2//JgKFTxLTY='
WHERE
key_id = '631d39e4a86ea7e7ad1f731159eb6a84b30f4f72891c6f7be2a85c099c46a1af'
AND (
token = 'RqjvQV6ziJfvQHsJqYIl5AFTKgjkftT2//JgKFTxLTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)