UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IR46ki0S4HBhkWJu2VIWSy3nFGL7m/Gs+z+g5Wux3po=' 
WHERE 
  key_id = 'da7401dba03a737226e8763d26e14ffec0d37cf37fae97f409b4b401e8193b8f' 
  AND (
    token = 'IR46ki0S4HBhkWJu2VIWSy3nFGL7m/Gs+z+g5Wux3po=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028