UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8TimI4YjTUY/NGU+thhjhQqzexwh1lvD8ZzOdxnZXCM='
WHERE
key_id = '92ef695fab7fb984eb9f4148bd263590cfb06e797d5b58acba2d28020268bbe7'
AND (
token = '8TimI4YjTUY/NGU+thhjhQqzexwh1lvD8ZzOdxnZXCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)