UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j5eUYrCNadNZFqSIRAXvhjwKOnSEEIKNo6w/DhdaHvc=' 
WHERE 
  key_id = '5b8191551c4df291b992d1e924f11e642c88ccdf8a57884793cd04d216762fc1' 
  AND (
    token = 'j5eUYrCNadNZFqSIRAXvhjwKOnSEEIKNo6w/DhdaHvc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036