UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+bsT2+gOrTKPr5gHSbuHNNVrjiEOFXAGpMCFs4IVl3M=' 
WHERE 
  key_id = '3d3b76c7a6196cf657e8fb3cbd4419d94af64e14870057761aa224d80527f3ac' 
  AND (
    token = '+bsT2+gOrTKPr5gHSbuHNNVrjiEOFXAGpMCFs4IVl3M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032