UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3X65Wu25owYDYDhl9lFUiklKQtCbEUg3i3DKOqCcg+E=' 
WHERE 
  key_id = '62c86f5a63f5d82ae5303282d6b236b69d95f9ef7a588fd909ec8044d88cbaf8' 
  AND (
    token = '3X65Wu25owYDYDhl9lFUiklKQtCbEUg3i3DKOqCcg+E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039