UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RMQ6tbJPfLVCI9/TTp6CgiANvfsYshKnQZoSht9K6+s='
WHERE
key_id = '9739c354debdd0ef93adbd757f5a9270d5b8b68c5df4ae5ae2b785ebb3cd9921'
AND (
token = 'RMQ6tbJPfLVCI9/TTp6CgiANvfsYshKnQZoSht9K6+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)