UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o708dr64jheRnSBEb0hyKej5efzpryF9Wd21/wd9v0M=' 
WHERE 
  key_id = '9361a5e58edc1a42f16677238f5341fc203b6607ed9279f3481d507c4efe40c7' 
  AND (
    token = 'o708dr64jheRnSBEb0hyKej5efzpryF9Wd21/wd9v0M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033