UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+hTSYKUx+G2eXv3Dc1RJYZfJAlB7oEnb4BMESLxARHg=' 
WHERE 
  key_id = '93f327ca87980821049d0bc6b84f851779ad920e1fdf316fc6879da219451dc0' 
  AND (
    token = '+hTSYKUx+G2eXv3Dc1RJYZfJAlB7oEnb4BMESLxARHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023