UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7DNyKkvDxiDNfxv17fIvOGJ/esnwdJ/8+vnYxp4e/4A=' 
WHERE 
  key_id = '3305762de34dc88bdcf341a160a786c9db4b3b1aa81dc5cd7abeb88c8c146b7f' 
  AND (
    token = '7DNyKkvDxiDNfxv17fIvOGJ/esnwdJ/8+vnYxp4e/4A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049