UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rn4gPWjcbTyaI0q6Rsi/eWecF2okRbm0lqb9F1yO2Hg=' 
WHERE 
  key_id = '9f06d5741789f04f8358bc3aa94cdc92c067e218bc2c750ebca5d30d7074e0cd' 
  AND (
    token = 'Rn4gPWjcbTyaI0q6Rsi/eWecF2okRbm0lqb9F1yO2Hg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015