UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NVOI4iLkx5d8CDVQ6rEXnIZ2JEWrcGuNIrRmY3QOL8M=' 
WHERE 
  key_id = 'a06600219ce1851bd928374aba27badd9dafb6905caf9b2b2387f5c0f77df07c' 
  AND (
    token = 'NVOI4iLkx5d8CDVQ6rEXnIZ2JEWrcGuNIrRmY3QOL8M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019