UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rN7OMQORDxzHmgp5u1+NiYMlWKdkbeS5NIhfdSh3hOE='
WHERE
key_id = '3a847150bbfafd569c809edef7e408cf3a5a45efa5353b27ac0778cb29133eff'
AND (
token = 'rN7OMQORDxzHmgp5u1+NiYMlWKdkbeS5NIhfdSh3hOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)