UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wldpcpO+MswGsuOTAkgSVcTErXDEfsDNZqGqcpbfTmM=' 
WHERE 
  key_id = 'e271592f44da8517cd99d5712775cb2a6fd704f9fc21658fc3bd0f5341931a76' 
  AND (
    token = 'wldpcpO+MswGsuOTAkgSVcTErXDEfsDNZqGqcpbfTmM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030