UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '19Rj+4g+X0I+ZYBeNVXvzlewx0FEkC8aJi0F4Ajt9Ug=' 
WHERE 
  key_id = '3fb9825d3882597a6fc4aca8657247cf219c58a61c3d445e9e7f5126ee4c7cb4' 
  AND (
    token = '19Rj+4g+X0I+ZYBeNVXvzlewx0FEkC8aJi0F4Ajt9Ug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028