UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vxV7xiKcYb/7lLcXM8jYakS9BOxjou01WDOJe+NiOoQ=' 
WHERE 
  key_id = '530974f4a4a8df45554fc3452f2d46e8da57aea25f3030e85884fdbd4cc59e02' 
  AND (
    token = 'vxV7xiKcYb/7lLcXM8jYakS9BOxjou01WDOJe+NiOoQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028