UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JNOsqTK2YnVmpp1KpHmB4JMm6vPf+UVHF7cY3T7DqrM='
WHERE
key_id = 'e4b63a9a3871ed29c59b38b2822abc4e2e2a9b185cb13deba715e691fbf686b3'
AND (
token = 'JNOsqTK2YnVmpp1KpHmB4JMm6vPf+UVHF7cY3T7DqrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)