UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5HnGtZaU9cGBkGCXgWjdvg40qVSjbTl7z7q7zXIv11I=' 
WHERE 
  key_id = '070af42a5c5ccfb3bd6eaaa3650688c8427cc032433d73fd9a9cf7c0ab723b66' 
  AND (
    token = '5HnGtZaU9cGBkGCXgWjdvg40qVSjbTl7z7q7zXIv11I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00103