UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1+W8Kl9BU1Pwbt1/KHN8Ry6x6bLHdEQPFKahQZT2R04='
WHERE
key_id = 'd9a676638469d5c27df427debcdfd6cbaeaa40436cd71f42cee935855da258eb'
AND (
token = '1+W8Kl9BU1Pwbt1/KHN8Ry6x6bLHdEQPFKahQZT2R04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)