UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZS5mUMwyCgOMT56VBcKQLDPV/jIX6gaPXqeSthCU2hg=' 
WHERE 
  key_id = '5ef75b1d3de66d637835a0ae5e6340a7c689ec161409793cd7537b674db92b2d' 
  AND (
    token = 'ZS5mUMwyCgOMT56VBcKQLDPV/jIX6gaPXqeSthCU2hg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052