UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uxksHBsgZF9Z4lKOnhzs7JRUdChDLz2hGWz1a0uzE8w=' 
WHERE 
  key_id = '9e53540913e52f068b197765df2158cb46ecaad4dcbbcf23ede821a36be358c3' 
  AND (
    token = 'uxksHBsgZF9Z4lKOnhzs7JRUdChDLz2hGWz1a0uzE8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032