UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M80yVxX/EGffk40we9UjXS2fFW+j4g6KL+gmQPPy5hI='
WHERE
key_id = 'dd5c1b3872b5e60870ad8d104b3ecfaf4bc7a8a77e42b310e53ea4caf0bde34f'
AND (
token = 'M80yVxX/EGffk40we9UjXS2fFW+j4g6KL+gmQPPy5hI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)