UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3F6niW7R5ng46guFBp9tO7Gg98H5Phd/JK3L2K61glg='
WHERE
key_id = '5750da7114c65a433fcaa61dd1d4271b6cdeba615b5b79359bdf99454b12e714'
AND (
token = '3F6niW7R5ng46guFBp9tO7Gg98H5Phd/JK3L2K61glg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)