UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '70BTCtj1VXmYcLjeZXRHKhDRNeJ7uY6YWfmBYFp0Hbs=' 
WHERE 
  key_id = '9745363affc00896acf89884df5c0f47daf18eff9949fa8b9ce15d18657d23d3' 
  AND (
    token = '70BTCtj1VXmYcLjeZXRHKhDRNeJ7uY6YWfmBYFp0Hbs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055