UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Nw2Ji5FSWnLLZW9+pvnXieIwlI0vE602+jEanFaPjE=' 
WHERE 
  key_id = '60f854148961ad2a9d1e2e77a22722d55e6e94d5174acc0f2c50ddbc49d941db' 
  AND (
    token = '7Nw2Ji5FSWnLLZW9+pvnXieIwlI0vE602+jEanFaPjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040