UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '45GmFzR5EHmYvExIUVNWxWaTfR0PknRFzu6O/gRWx+w='
WHERE
key_id = '4fa05b07fe3b43ec3d96c3f6e6bbf810d3c774c51ad6cc385392ea8408be58d6'
AND (
token = '45GmFzR5EHmYvExIUVNWxWaTfR0PknRFzu6O/gRWx+w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)