UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nnyBDzXk3xZvuvKacgbJQrmzuq0eSeroYc+L8cgkP4o='
WHERE
key_id = '6b13f6c466cc30958f49fc3b7432bd14f60acd2236391f9685a0ad830543d674'
AND (
token = 'nnyBDzXk3xZvuvKacgbJQrmzuq0eSeroYc+L8cgkP4o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)