UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Iy+3Xq0181LGbBTYzFkhx1S9IHq7BFcelQFOBbuxM9U='
WHERE
key_id = '80d0d07d97b6a52bfec2d548f8680e441253051f85cd829287ba78052bd0a256'
AND (
token = 'Iy+3Xq0181LGbBTYzFkhx1S9IHq7BFcelQFOBbuxM9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)