UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Ed3XblHo1JL91krQest8MGILhFKLIp/H8KuRzPHeBg=' 
WHERE 
  key_id = 'ae5113668c9737bf60abb28f7aa86cd2403170656b73d0f2089f270d7f911b76' 
  AND (
    token = '3Ed3XblHo1JL91krQest8MGILhFKLIp/H8KuRzPHeBg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00210