UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '48qy+qlT1uWY5wKmN94uzlk9px0DvICGA9Ovgchkt6s=' 
WHERE 
  key_id = 'c768f81fae2da340a5dc5021907951125872bdcf9153f43b5e7d9f8e6391b96a' 
  AND (
    token = '48qy+qlT1uWY5wKmN94uzlk9px0DvICGA9Ovgchkt6s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00065