UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's7vxkFzaUx19ERTi+H4uCsuQ/oc8oNBRQ0+1WkeLddU='
WHERE
key_id = '3b4ac2741bd79bdb1aa123dd340ba3f4ed5fa6df33b32874d7ac493aefe345eb'
AND (
token = 's7vxkFzaUx19ERTi+H4uCsuQ/oc8oNBRQ0+1WkeLddU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)