UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hskIh0PZijKsjKi7E9UKlbe3H0zAYZHhahcfQAJIk4Q='
WHERE
key_id = 'b689a57a2a91ad482c1648cd0e7be9b67d315ba5f1f49e1fbe934dc731b04bcb'
AND (
token = 'hskIh0PZijKsjKi7E9UKlbe3H0zAYZHhahcfQAJIk4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)