UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TNX5mcfQPnz2lMRDO2qT1e2Qr2wELBBzrevBYyly0AI=' 
WHERE 
  key_id = '07326dd6101c269799020f59251387633748cbb6defef2f53232d7c123bab321' 
  AND (
    token = 'TNX5mcfQPnz2lMRDO2qT1e2Qr2wELBBzrevBYyly0AI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034