UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f1jxJ08b9Kqv4Va63CIL2Hi84zE2GxKU/c6/JnOXFjE='
WHERE
key_id = '540acbdad9516687a0a61b2a4ed5ce3ac5dcdb60fd7e0474cd1f0ead6f18678f'
AND (
token = 'f1jxJ08b9Kqv4Va63CIL2Hi84zE2GxKU/c6/JnOXFjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)