UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Ea3uCLw1XyVGpNLFlDYAj1UFmAZMqRNxflFXZSaT8k=' 
WHERE 
  key_id = '28cc2a70a3f2b0beab3d102e45b2e34b1002d1fa3a1ac013117585e579932b44' 
  AND (
    token = '4Ea3uCLw1XyVGpNLFlDYAj1UFmAZMqRNxflFXZSaT8k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036