UPDATE 
  cscart_aprillock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TThGTOnvtLMrxrPqyheh3+rZ55TIOux519B30e5RCv0=' 
WHERE 
  key_id = '46a17c7946698cd9c93b50f1dd0501d9669c3bbc1c92c5aac4a41b7a3429c179' 
  AND (
    token = 'TThGTOnvtLMrxrPqyheh3+rZ55TIOux519B30e5RCv0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036