UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ukTQunUZzB8jfyGROODwKpfi95ITY/Kd+xnj1NqSENg=' 
WHERE 
  key_id = '2d0002ccd81ad57bfaaea26a3768261b13f347c2dacc98ad8e9542a1b3a3b17f' 
  AND (
    token = 'ukTQunUZzB8jfyGROODwKpfi95ITY/Kd+xnj1NqSENg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042