UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MCW1dynRPTcpFdsc4D5IeoU6MIZr21rOFBmG3ewXLqc='
WHERE
key_id = '19528285f77b4e30aa24d94b5e52ca0edf37fde98ef501573d54d84ae5e8a57e'
AND (
token = 'MCW1dynRPTcpFdsc4D5IeoU6MIZr21rOFBmG3ewXLqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)